/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.itver.uml.palette;

/**
 *
 * @author Viruz
 */
import java.io.IOException;
import org.netbeans.spi.palette.PaletteController;
import org.netbeans.spi.palette.PaletteFactory;

public class MyPalette {
    private static PaletteController controller;

    public MyPalette(){
    }

    public static PaletteController getPaleta() {
        try {
              controller = PaletteFactory.createPalette("UML", new MyPaletteActions(), null, null );
        } catch (IOException ex) {
        }
//        return null;
//        controller.addPropertyChangeListener(new PropertyChangeListener() {
//            @Override
//            public void propertyChange(PropertyChangeEvent evt) {
//                if( PaletteController.PROP_SELECTED_ITEM.equals(evt.getPropertyName())){
//                    Lookup selItem = controller.getSelectedItem();
//                    if( null != selItem ) {
//                        Node selNode = (Node)selItem.lookup( Node.class );
//                        if( null != selNode ) {
//                            Image selImage = selNode.getIcon(BeanInfo.ICON_COLOR_32x32);
//                            String selName = selNode.getDisplayName();
//                            UMLPaletaTopComponent.findInstance().setCard(selName,selImage);
//                         }
//                    }
//                }
//              }
//            });
        return controller;
      }
}
